<template>
  <el-card class="operate-container" shadow="never">
    <i class="el-icon-tickets" />
    <span>简历列表</span>

    <el-table
      ref="multipleTable"
      :data="tableData"
      :default-sort="{prop: 'name', order: 'descending'}"
      tooltip-effect="dark"
      style="width: 100%"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" />
      <el-table-column label="岗位编号" prop="id" sortable>
        <template slot-scope="scope">{{ scope.row.id }}</template>
      </el-table-column>
      <el-table-column prop="sender" label="应聘者" sortable />
      <el-table-column prop="post" label="应聘岗位" sortable />
      <el-table-column prop="education" label="学历" sortable />
      <el-table-column prop="accept_time" label="接受时间" sortable />
      <el-table-column prop="affix" label="简历附件" sortable />
    </el-table>
    <div style="margin-top: 20px">
      <el-button type="primary" @click="deliver()">选择后，面试申请</el-button>
    </div>

  </el-card>

</template>

<script>
// 传入简历列表
import { getResumeList } from '@/api/recruit'

export default {
  data() {
    return {
      tableData: [],
      multipleSelection: []
    }
  },
  created: function() {
    // 获取岗位信息
    getResumeList().then((res) => {
      this.tableData = res.data

      for (const a of this.tableData) {
        // 时间格式转化
        const d = new Date(a.accept_time)
        a.accept_time = d.toLocaleString()
      }

      console.log(this.tableData)
    })
  },
  methods: {

    // 获取多选数据的数组
    handleSelectionChange(val) {
      this.multipleSelection = val
    },

    // 调用录用申请
    deliver() {

    }

  }
}
</script>
